﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ChangePassword.aspx.cs" Inherits="ChangePassword" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="Stylesheet" type="text/css" href="Styles/StyleSheetApplicant.css" />
    <script type="text/javascript" src="Scripts/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#<%=txtPassword.ClientID %>').blur(function () {
                HidenShowButton();
            });
            $('#<%=txtNewPassword.ClientID %>').blur(function () {
                HidenShowButton();
            });
            $('#<%=txtPasswordConfirm.ClientID %>').blur(function () {
                HidenShowButton();
            });
            function HidenShowButton() {
                $('#<%=btnChagepassword.ClientID %>').attr('disabled', true);
                $('#<%=lblError.ClientID %>').html("");
                if ($('#<%=txtPassword.ClientID %>').val() == "") {
                    $('#<%=lblError.ClientID %>').html("My Password can not be empty.");
                }
                else if ($('#<%=txtNewPassword.ClientID %>').val() == "") {
                    $('#<%=lblError.ClientID %>').html("New Password can not be empty.");
                }
                else if ($('#<%=txtPasswordConfirm.ClientID %>').val() == "") {
                    $('#<%=lblError.ClientID %>').html("New Password can not be empty.");
                }
                else {
                    $('#<%=btnChagepassword.ClientID %>').attr('disabled', false);
                }
            }
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder" Runat="Server">
    <div id="MainApply">
        <h2>Change password</h2>
        <p class="LineOdd">
            <asp:Label ID="Label1" runat="server" Text="UserName:" Width="180px" ></asp:Label>
            <asp:Label ID="txtUser" runat="server" Width="200px"></asp:Label>
        </p>
        <p>
            <asp:Label ID="Label3" runat="server" Text="Password:" Width="180px" ></asp:Label>
            <asp:TextBox ID="txtPassword" runat="server" Width="200px" TextMode="Password"></asp:TextBox>
        </p>
        <p class="LineOdd">
            <asp:Label ID="Label2" runat="server" Text="Password:" Width="180px" ></asp:Label>
            <asp:TextBox ID="txtNewPassword" runat="server" Width="200px" 
                TextMode="Password"></asp:TextBox>
        </p>
        <p>
            <asp:Label ID="Label4" runat="server" Text="Password:" Width="180px" ></asp:Label>
            <asp:TextBox ID="txtPasswordConfirm" runat="server" Width="200px" 
                TextMode="Password"></asp:TextBox>
        </p>
        <p style="text-align: center; padding-left: 0px;">
            <asp:Button ID="btnChagepassword" runat="server" Text="Change Password" 
                Width="150px" CssClass="button" onclick="btnChagepassword_Click" />
        </p>
        <p style="text-align: center; padding-left: 0px;">
            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
        </p>
    </div>
</asp:Content>

